

import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver

chrome=webdriver.Chrome("chromedriver.exe")
driver=webdriver.chrome()
chrome.get("https://www.baidu.com/")
#定位元素
#显示等待
input_box=chrome.find_element(By.ID,"kw")
wait=WebDriverWait(chrome,10)
wait.until(EC.visibility_of(input_box))
input_box.send_keys("nihao")

#隐式等待
driver.implicitly_wait(4)
driver.find_element(By.ID,"kw").send_keys("nihao ")







